package com.hmall.mapper;

import com.hmall.model.SysCustomer;
import com.hmall.util.MyMapper;
import com.hmall.vo.SysUserDetailVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Repository
public interface SysCustomerMapper extends MyMapper<SysCustomer> {
    SysUserDetailVo selectByUserIdVo(Integer userId);

    List<Integer> selectCustomerIdLisstBySalsemanId(@Param("userId") Integer userId);

    SysCustomer selectByUserId(@Param("customerUserId") Integer customerUserId);

    Integer selectCustomerUserId(@Param("customerId") Integer customerId);

    void updateReceivemanInformation(@Param("customerId") Integer customerId, @Param("name") String invoiceReceivemanName, @Param("tel") String invoiceReceivemanTel, @Param("address") String invoiceReceivemanAddress);

    SysCustomer selectByLikeCustomerName(@Param("customerName") String customerName);

    SysCustomer selectCustomerByUserId(@Param("userId") Integer userId);

    Integer selectSalsmanCountByUserId(@Param("userId") Integer userId);

    List<Integer> selectSalsmanByUserId(@Param("userId") Integer userId);

    /**
     * 根据业务员id列表得到绑定的公司信息
     * @param salesmanIdList
     * @return
     */
    List<SysCustomer> selectAllBySalesmanIdList(@Param("salesmanIdList") List<Integer> salesmanIdList);


}